 /*
 * Copyright 2010 Christoph Widulle (christoph.widulle@googlemail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

package com.android1.amarena2d.desktop;

import com.android1.amarena2d.engine.Config;
import com.android1.amarena2d.engine.AmarenaEngine;
import com.badlogic.gdx.backends.jogl.JoglApplication;

public abstract class AmarenaDesktopEngine extends AmarenaEngine {

    JoglApplication app;

    public AmarenaDesktopEngine(String name, int width, int height) {
        this(name, new Config(width, height));
    }

    public AmarenaDesktopEngine(String name, Config config) {
        app = new JoglApplication(this, name, config.getCameraWith(), config.getCameraHeight(), config.useGL20IfAvailable());
        this.config = config;

    }

    @Override
    public abstract void onSurfaceCreated();

    @Override
    public void create() {
        init(app, config);
        super.create();
    }
}
